package userInterface;

import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.border.EmptyBorder;

public class RHWindow extends JFrame implements ActionListener{
	private static final long	serialVersionUID	= 9027495388875367976L;

	private JPanel contentPane;
	
	JButton btnCadastrarCliente;
	
	JButton btnBuscareditarCliente;
	
	JButton btnGerarRelatrioDe;
	
	JButton btnGerarFolhaDe;
	
	JButton btnCadstrarFuncionrio;
	
	JButton btnBuscareditarFuncionario;
	
	JButton btnCadastrarCategoria;
	
	JButton btnBuscareditarCategoria;
	
	JButton btnLogOut;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					RHWindow frame = new RHWindow();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public RHWindow() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		
		JLabel lblCasa = new JLabel("CASA");
		lblCasa.setFont(new Font(Font.SERIF, Font.ITALIC, 50));
		
		btnCadastrarCliente = new JButton("Cadastrar Cliente");
		
		btnBuscareditarCliente = new JButton("Buscar/Editar Cliente");
		
		btnGerarRelatrioDe = new JButton("Gerar Relat\u00F3rio de Clientes");
		
		btnGerarFolhaDe = new JButton("Gerar Folha de Pagamentos");
		
		btnCadstrarFuncionrio = new JButton("Cadstrar Funcion\u00E1rio");
		
		btnBuscareditarFuncionario = new JButton("Buscar/Editar Funcion[ario");
		
		btnCadastrarCategoria = new JButton("Cadastrar Categoria");
		
		btnBuscareditarCategoria = new JButton("Buscar/Editar Categoria");
		
		btnLogOut = new JButton("Log Out");
		btnLogOut.addActionListener(this);
		
		GroupLayout gl_contentPane = new GroupLayout(contentPane);
		gl_contentPane.setHorizontalGroup(
			gl_contentPane.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
							.addGroup(gl_contentPane.createSequentialGroup()
								.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
									.addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
										.addComponent(btnGerarRelatrioDe, GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)
										.addPreferredGap(ComponentPlacement.RELATED))
									.addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
										.addComponent(btnCadastrarCliente, GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)
										.addPreferredGap(ComponentPlacement.RELATED))
									.addGroup(gl_contentPane.createSequentialGroup()
										.addComponent(btnBuscareditarCliente, GroupLayout.PREFERRED_SIZE, 203, Short.MAX_VALUE)
										.addPreferredGap(ComponentPlacement.RELATED)))
								.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
									.addComponent(btnGerarFolhaDe, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
									.addComponent(btnBuscareditarCategoria, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
									.addComponent(btnCadastrarCategoria, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
									.addComponent(btnBuscareditarFuncionario, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
									.addComponent(btnCadstrarFuncionrio, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
								.addContainerGap())
							.addGroup(Alignment.TRAILING, gl_contentPane.createSequentialGroup()
								.addComponent(lblCasa)
								.addGap(142)))
						.addComponent(btnLogOut, Alignment.TRAILING)))
		);
		gl_contentPane.setVerticalGroup(
			gl_contentPane.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPane.createSequentialGroup()
					.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
						.addGroup(gl_contentPane.createSequentialGroup()
							.addContainerGap()
							.addComponent(lblCasa))
						.addComponent(btnLogOut))
					.addGap(18)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnCadastrarCliente)
						.addComponent(btnCadstrarFuncionrio))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(btnBuscareditarFuncionario)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnCadastrarCategoria)
						.addComponent(btnBuscareditarCliente))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(btnBuscareditarCategoria)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnGerarRelatrioDe)
						.addComponent(btnGerarFolhaDe))
					.addContainerGap(19, Short.MAX_VALUE))
		);
		contentPane.setLayout(gl_contentPane);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == btnCadastrarCliente){
			
		}
		else if (e.getSource() == btnBuscareditarCliente){
			
		}
		else if (e.getSource() == btnGerarRelatrioDe){
			
		}
		else if (e.getSource() == btnGerarFolhaDe){
			
		}
		else if (e.getSource() == btnCadstrarFuncionrio){
			
		}
		else if (e.getSource() == btnBuscareditarFuncionario){
			
		}
		else if (e.getSource() == btnCadastrarCategoria){
			
		}
		else if (e.getSource() == btnBuscareditarCategoria){
			
		}
		else if (e.getSource() == btnLogOut){
			LoginWindow.getInstance().setVisible(true);
		}
		this.setVisible(false);
	}

}
